<?php $this->load->view('header'); ?>

	<div id="content">
	<?php if (isAccess('myuser','message','view')) : ?>
		<?php $newMessage = getCountNewMessage();?>
		<?php if ($newMessage) : ?>
			<a href="<?php echo site_url('myuser/message/view/tipe/inbox');?>">
				<span class="notification new-mail"><strong><?php echo $newMessage;?> Pesan Baru Diterima</strong></span>
	    	</a>
		<?php endif;?>
	<?php endif;?>
	
	<div class="column full ui-sortable">
	
		<!-- Right Column -->
		<div class="width30 fr">
			<div class="box-header">Informasi User</div>
			<div class="box-content">
			 <label class="form-label">User Name : <?php echo getUserLogin()?></label>
			 <label class="form-label">Nama : <?php echo getUserName()?></label>
             <label class="form-label">IP Address : <?php echo $this->input->ip_address();?></label>
			 <?php $lastLogin = getUserLastLogin(); ?>
			 <?php if ($lastLogin) : ?>
			 <label class="form-label">Last Login : <?php echo date('d, M Y H:i:s',SQLTimeToMKTime($lastLogin['userLoginCreateTime']));?></label>
             <label class="form-label">Last Login IP : <?php echo $lastLogin['userLoginIp'];?></label>
			 <?php endif;?>
			</div>
			<br />
            <div class="box-header"><?php echo anchor('myuser/user/online','Online User');?></div>
            <div class="box-content box-table">
                 <table width="100%">
                    <thead class="table-header">
                        <tr>
                            <th>User Name</th>
                            <th>IP Address</th>
                        </tr>
                    </thead>
                    <?php $i = true;?>
                    <?php if ($listOnline) : ?>
                    <tbody>
                    <?php foreach ($listOnline as $row): ?>
                    <?php $i = $i ? false : true;?>
                        <tr class="<?php echo $i ? 'even' : 'odd'?>">
                            <td><?php echo $row['userLogin']?></td>
                            <td><?php echo $row['userIP']?></td>
                        </tr>
                    <?php endforeach;?>
                    </tbody>
                    <?php endif;?>
                 </table>
            </div>			
		</div>
		<!-- End Right Column -->
	
		<!-- Left Column -->
		<div class="width70 fl">

			<div class="box-content box-table">
				<?php echo $paging?>
	            <table class="tablebox">
	            <thead class="table-header" style="border-top:1px solid #ccc;border-bottom:1px solid #ccc">
	                <tr>
	                	<th width="10">No</th>
	                	<th>RJ Kode</th>
	                    <th width="250">Nama</th>
	                    <th>Jenkel</th>
	                    <th>Usia</th>
	                </tr>
	            </thead>
	            <tbody>
	            	<?php $no = get_data($uri_to_assoc,'page')+1;?>
	                <?php if ($dataView) foreach($dataView as $row) : ?>
	                <?php $class = $no % 2 == 0 ? 'even' : 'odd' ?>
	                <tr class=<?php echo $class?>>
	                	<td><?php echo $no;?></td>
	                    <td><?php echo get_data($row,'rmKode')?></td>
	                    <td><?php echo get_data($row,'pasienNama')?></td>
	                    <td><?php echo get_data($row,'pasienJenKel')?></td>
	                    <td><?php echo getUsia( get_data($row,'pasienTglLahir') )?></td>
	                </tr>
	                <?php $no++?>
	                <?php endforeach;?>
	            </tbody>
	            </table>
	            <div id="paging">
	            <?php echo $paging?>
	            </div>
            </div>
			
		</div>
		<!-- End Left Column -->
		
	</div>

<?php $this->load->view('footer'); ?>
